<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const p = {
            name:'zhangsan',
            age: 18,
            color :'red',
        };

        const arr = [];
        const arr1 = [];
        for (const key in p) {
            arr.push(p[key]);
            arr1.push(key);
        }
        console.log(arr);
        console.log(arr1);

        console.log(Object.values(p));
        console.log(Object.keys(p));
        
        const arrList = {
            name:'zhangsan',
            age: 18,
            color :'red',
            children : [
                {
                    name:'wangmazi',
                    age: 18,
                    color :'red',
                },
                {
                    name:'lisi',
                    age: 18,
                    color :'red',
                },
                {
                    name:'niuwu',
                    age: 18,
                    color :'red',
                },
            ]
        };
        const arr2 = arrList.children.map((item) => item.name);
        console.log(arr2);

    </script>
</body>
</html>